<template>
	<view class="" style="background-color: #f8f8f8;height: 100vh;">
		<view class="dis_f aic juc " style="width: 100%;" v-if="shuomtext.length == 0">
			暂无数据
		</view>
		<view class="mian" @click="jump(item)" v-for="(item,index) in shuomtext" :key="index">
			<view class="dis_f aic jub">
				<view class="fs28">
					信息评测报告
				</view>
				<view class="fs30" style="color: #f26962;" v-if="item.status == -1">
					订单关闭
				</view>
				<view class="fs30" style="color: #fdbe51;" v-if="item.status == 0">
					等待支付
				</view>
				<view class="fs30" style="color: #2686fe;" v-if="item.status == 1 && item.is_tk == 0">
					报告已生成
				</view>
				<view class="fs30" style="color: #f26962;" v-if="item.is_tk == 1 && item.status == 1">
					已退款
				</view>
			</view>
			<view class="dis_f aic jub mt30">
				<view class="fs24 c9">
					订单号：{{item.sn}}
				</view>
				<image src="../../static/images/fuzhi.png" mode="" class="fuz" @click.stop="fuzhicli(item.sn)"></image>
			</view>
			<view class="fs24 mt30 c9">
				{{item.addtime}}
			</view>
		</view>
		<view class="title dis_f juc ">
			问题仍未解决？立即联系
			<!-- <a style="color: #2785fe;" :href="'tel:+'+kf_tel">客服留言</a> -->
			<text @click="liuyan(kf_tel)" style="color: #2785fe;">客服留言</text>
			>>
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				shuomtext: [],
				kf_tel: ""
			}
		},
		onLoad() {
			this.kf_tel = uni.getStorageSync('kf_tel')
			this.shuomlist()
		},
		methods: {
			liuyan(kf_tel) {
				uni.makePhoneCall({
					phoneNumber: kf_tel,
					success: function() {
						console.log('拨打电话成功！');
					},
					fail: function() {
						console.log('拨打电话失败！');
					}
				});
			},
			fuzhicli(item) {
				uni.setClipboardData({
					data: item
				})
				uni.showToast({
					title: '复制成功',
					icon: "none"
				})
			},
			shuomlist() {
				this.api.post('service/selectOrder').then(res => {
					console.log(res);
					if (res.code == 200) {
						this.shuomtext = res.data
					}
				})
			},
			jump(item) {
				if (item.is_tk == 1) {
					uni.showToast({
						title: '已退款,不可查看',
						icon: "none"
					})
					return false
				}
				if (item.status == 1) {
					uni.navigateTo({
						url: '/pages/index/index?id=' + item.id
					})
				}
				if (item.status == 0) {
					uni.navigateTo({
						url: '/pages/payment/payment?id=' + item.id
					})
				}
			},
		}
	}
</script>

<style>
	.title {
		margin-left: 30rpx;
		margin-top: 50rpx;
		font-size: 28rpx;
	}

	.fuz {
		width: 30rpx;
		height: 35rpx;
	}

	.mian {
		width: 100%;
		padding: 25rpx;
		box-sizing: border-box;
		background-color: #fff;
		margin-top: 20rpx;
	}
</style>